<?php 
$this->pageTitle = 'Open Dispatch Report';
?>
<center><h1>Open Dispatch Report</h1></center>
<br/>
<br/>
<?php 
$table = new CI_Table();
$table->set_template(array(
	'table_open'=>'<table width="100%">'
));
$table->set_heading(array(
	'Dispatch',
	'Department',
	'Technician',
	'Status',
	'Received Date',
	'Received Time'
));
foreach($dispatchList as $dispatch){
	$item = array($dispatch->dispatch,$dispatch->department);
	if($dispatch->lastestTech!=null && $dispatch->lastestTech->employee!=null){
		$item[] = $dispatch->lastestTech->employee->firstname.' '.$dispatch->lastestTech->employee->lastname;
		$item[] = $dispatch->lastestTech->status;
	}
	$item[] = substr($dispatch->receiveddate,0,10);
	$item[] = $dispatch->receivedtime;
	$table->add_row($item);
}
echo $table->generate();
?>
